//
//  learnstl.cpp
//  HelloWorld
//
//  Created by Kevin Tang on 30/12/14.
//  Copyright (c) 2014年 Kevin Tang. All rights reserved.
//

#include "learnstl.h"

using namespace std;

void test_list_vect()
{
    list<int> coll1;
    vector<int> coll2;
    for(int i=1;i<=9;i++){
        coll1.push_back(i);
    }
    
    coll2.resize(coll1.size());//调整大小
    copy(coll1.begin(), coll1.end(), coll2.begin());//拷贝
    for (int j=0; j<coll2.size(); j++) {
        cout<<coll2[j]<<endl;
    }
    
    deque<int> coll3(coll1.size());
    copy(coll1.begin(), coll1.end(), coll3.begin());
    for (int m=0; m<9; m++) {
        cout<<coll3[m]<<endl;
    }
    
}







